package com.mcf.xiaolinju.controller;


import com.mcf.xiaolinju.entity.TbCity;
import com.mcf.xiaolinju.service.impl.TbCityServiceImpl;
import com.mcf.xiaolinju.vo.TreeVo;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mcf
 * @since 2022-01-04
 */
@CrossOrigin
@RestController
@RequestMapping("/xiaolinju/tb-city")
public class TbCityController {
    @Resource
    TbCityServiceImpl tbCityService;
    //根据省份id查城市
    @RequestMapping("/getcity")
    public List<TbCity> getcity(int procinceid){
        return tbCityService.getcity(procinceid);
    }
    //查询所有
    @RequestMapping("/getAll")
    public List<TbCity> getAll(){ return tbCityService.list();}
    //小程序查询省市区
    @RequestMapping("/getallmessage")
    public List<TreeVo> getallmessage(){
        return  tbCityService.gettree();
    }
    


}
